package cn.gailvlun.gll.presentation.emotion;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;

import cn.gailvlun.gll.net.emotion.EmotionEnum;



@Deprecated
public class EmotionSquarePagerAdapter extends FragmentStatePagerAdapter {
    public EmotionSquarePagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0: {
                return EmotionSquareFragment.newInstance(EmotionEnum.S);
            }
            case 1: {
                return EmotionSquareFragment.newInstance(EmotionEnum.F);
            }
            case 2: {
                return EmotionSquareFragment.newInstance(EmotionEnum.N);
            }
            default: {
                return EmotionSquareFragment.newInstance(EmotionEnum.S);
            }
        }
    }

    @Override
    public int getCount() {
        return EmotionEnum.values().length;
    }

    private EmotionSquareFragment mCurrentFragment;

    @Override
    public void setPrimaryItem(ViewGroup container, int position, Object object) {
        super.setPrimaryItem(container, position, object);
        mCurrentFragment = (EmotionSquareFragment) object;
    }

    public EmotionSquareFragment getCurrentFragment() {
        return mCurrentFragment;
    }
}
